; LLVM IR from ElsevierSoftwareX/SOFTX-D-20-00016 :: GameplayFootball/src/misc (shell)

; 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.callback_data = type { ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, [20 x i8], [100 x i32], [100 x i32], [20 x i8], %struct.previous_mode_data, [4096 x i8], ptr, ptr, ptr }
%struct.previous_mode_data = type { i32, i32, i32, [100 x i32] }

@Argv0 = external hidden global ptr, align 8
@stdin_is_interactive = external hidden global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@stdout = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@bail_on_error = external hidden global i32, align 4
@.str.20 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [19 x i8], align 1
@stdin = external global ptr, align 8
@.str.30 = external hidden unnamed_addr constant [35 x i8], align 1
@db = external hidden global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.callback_data, 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 i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store ptr null, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 5432, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 0
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %20, ptr @Argv0, align 8, !tbaa !9
  call void @main_init(ptr noundef %7)
  %21 = call i32 @isatty(i32 noundef 0) #7
  store i32 %21, ptr @stdin_is_interactive, align 4, !tbaa !5
  %22 = call ptr @signal(i32 noundef 2, ptr noundef @interrupt_handler) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %109, %2
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sub nsw i32 %25, 1
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %28, label %112

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = load i32, ptr %10, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds ptr, ptr %29, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %33, i64 0
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  %37 = icmp ne i32 %36, 45
  br i1 %37, label %38, label %39

38:                                               ; preds = %28
  store i32 2, ptr %13, align 4
  br label %106

39:                                               ; preds = %28
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = load i32, ptr %10, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  store ptr %44, ptr %12, align 8, !tbaa !9
  %45 = load ptr, ptr %12, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %45, i64 0
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 45
  br i1 %49, label %50, label %59

50:                                               ; preds = %39
  %51 = load ptr, ptr %12, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %51, i64 1
  %53 = load i8, ptr %52, align 1, !tbaa !11
  %54 = sext i8 %53 to i32
  %55 = icmp eq i32 %54, 45
  br i1 %55, label %56, label %59

56:                                               ; preds = %50
  %57 = load ptr, ptr %12, align 8, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %57, i32 1
  store ptr %58, ptr %12, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %56, %50, %39
  %60 = load ptr, ptr %5, align 8, !tbaa !9
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = call i32 @strcmp(ptr noundef %64, ptr noundef @.str) #8
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %75, label %67

67:                                               ; preds = %59
  %68 = load ptr, ptr %5, align 8, !tbaa !9
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds ptr, ptr %68, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = call i32 @strcmp(ptr noundef %72, ptr noundef @.str.1) #8
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %78

75:                                               ; preds = %67, %59
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !5
  br label %105

78:                                               ; preds = %67
  %79 = load ptr, ptr %5, align 8, !tbaa !9
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = call i32 @strcmp(ptr noundef %83, ptr noundef @.str.2) #8
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %94

86:                                               ; preds = %78
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %10, align 4, !tbaa !5
  %89 = load ptr, ptr %5, align 8, !tbaa !9
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  store ptr %93, ptr %8, align 8, !tbaa !9
  br label %104

94:                                               ; preds = %78
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = call i32 @strcmp(ptr noundef %99, ptr noundef @.str.3) #8
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %94
  store i32 0, ptr @stdin_is_interactive, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %102, %94
  br label %104

104:                                              ; preds = %103, %86
  br label %105

105:                                              ; preds = %104, %75
  store i32 0, ptr %13, align 4
  br label %106

106:                                              ; preds = %105, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %107 = load i32, ptr %13, align 4
  switch i32 %107, label %471 [
    i32 0, label %108
    i32 2, label %112
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !5
  br label %23, !llvm.loop !12

112:                                              ; preds = %106, %23
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %116, label %124

116:                                              ; preds = %112
  %117 = load ptr, ptr %5, align 8, !tbaa !9
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !5
  %120 = sext i32 %118 to i64
  %121 = getelementptr inbounds ptr, ptr %117, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 15
  store ptr %122, ptr %123, align 8, !tbaa !14
  br label %126

124:                                              ; preds = %112
  %125 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 15
  store ptr @.str.4, ptr %125, align 8, !tbaa !14
  br label %126

126:                                              ; preds = %124, %116
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %130, label %137

130:                                              ; preds = %126
  %131 = load ptr, ptr %5, align 8, !tbaa !9
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %10, align 4, !tbaa !5
  %134 = sext i32 %132 to i64
  %135 = getelementptr inbounds ptr, ptr %131, i64 %134
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  store ptr %136, ptr %9, align 8, !tbaa !9
  br label %137

137:                                              ; preds = %130, %126
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %141, label %152

141:                                              ; preds = %137
  %142 = load ptr, ptr @stderr, align 8, !tbaa !9
  %143 = load ptr, ptr @Argv0, align 8, !tbaa !9
  %144 = load ptr, ptr %5, align 8, !tbaa !9
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str.5, ptr noundef %143, ptr noundef %148) #7
  %150 = load ptr, ptr @stderr, align 8, !tbaa !9
  %151 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef @.str.6) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %469

152:                                              ; preds = %137
  %153 = load ptr, ptr @stdout, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 4
  store ptr %153, ptr %154, align 8, !tbaa !17
  %155 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 15
  %156 = load ptr, ptr %155, align 8, !tbaa !14
  %157 = call i32 @access(ptr noundef %156, i32 noundef 0) #7
  %158 = icmp eq i32 %157, 0
  br i1 %158, label %159, label %160

159:                                              ; preds = %152
  call void @open_db(ptr noundef %7)
  br label %160

160:                                              ; preds = %159, %152
  %161 = load ptr, ptr %8, align 8, !tbaa !9
  %162 = call i32 @process_sqliterc(ptr noundef %7, ptr noundef %161)
  store i32 %162, ptr %11, align 4, !tbaa !5
  %163 = load i32, ptr %11, align 4, !tbaa !5
  %164 = icmp sgt i32 %163, 0
  br i1 %164, label %165, label %167

165:                                              ; preds = %160
  %166 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %166, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %469

167:                                              ; preds = %160
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %371, %167
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = load i32, ptr %4, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %172, label %182

172:                                              ; preds = %168
  %173 = load ptr, ptr %5, align 8, !tbaa !9
  %174 = load i32, ptr %10, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds ptr, ptr %173, i64 %175
  %177 = load ptr, ptr %176, align 8, !tbaa !9
  %178 = getelementptr inbounds i8, ptr %177, i64 0
  %179 = load i8, ptr %178, align 1, !tbaa !11
  %180 = sext i8 %179 to i32
  %181 = icmp eq i32 %180, 45
  br label %182

182:                                              ; preds = %172, %168
  %183 = phi i1 [ false, %168 ], [ %181, %172 ]
  br i1 %183, label %184, label %374

184:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %185 = load ptr, ptr %5, align 8, !tbaa !9
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds ptr, ptr %185, i64 %187
  %189 = load ptr, ptr %188, align 8, !tbaa !9
  store ptr %189, ptr %14, align 8, !tbaa !9
  %190 = load ptr, ptr %14, align 8, !tbaa !9
  %191 = getelementptr inbounds i8, ptr %190, i64 1
  %192 = load i8, ptr %191, align 1, !tbaa !11
  %193 = sext i8 %192 to i32
  %194 = icmp eq i32 %193, 45
  br i1 %194, label %195, label %198

195:                                              ; preds = %184
  %196 = load ptr, ptr %14, align 8, !tbaa !9
  %197 = getelementptr inbounds i8, ptr %196, i32 1
  store ptr %197, ptr %14, align 8, !tbaa !9
  br label %198

198:                                              ; preds = %195, %184
  %199 = load ptr, ptr %14, align 8, !tbaa !9
  %200 = call i32 @strcmp(ptr noundef %199, ptr noundef @.str.2) #8
  %201 = icmp eq i32 %200, 0
  br i1 %201, label %202, label %205

202:                                              ; preds = %198
  %203 = load i32, ptr %10, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %10, align 4, !tbaa !5
  br label %367

205:                                              ; preds = %198
  %206 = load ptr, ptr %14, align 8, !tbaa !9
  %207 = call i32 @strcmp(ptr noundef %206, ptr noundef @.str.7) #8
  %208 = icmp eq i32 %207, 0
  br i1 %208, label %209, label %211

209:                                              ; preds = %205
  %210 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 5
  store i32 4, ptr %210, align 8, !tbaa !18
  br label %366

211:                                              ; preds = %205
  %212 = load ptr, ptr %14, align 8, !tbaa !9
  %213 = call i32 @strcmp(ptr noundef %212, ptr noundef @.str.8) #8
  %214 = icmp eq i32 %213, 0
  br i1 %214, label %215, label %217

215:                                              ; preds = %211
  %216 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 5
  store i32 2, ptr %216, align 8, !tbaa !18
  br label %365

217:                                              ; preds = %211
  %218 = load ptr, ptr %14, align 8, !tbaa !9
  %219 = call i32 @strcmp(ptr noundef %218, ptr noundef @.str.9) #8
  %220 = icmp eq i32 %219, 0
  br i1 %220, label %221, label %223

221:                                              ; preds = %217
  %222 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 5
  store i32 0, ptr %222, align 8, !tbaa !18
  br label %364

223:                                              ; preds = %217
  %224 = load ptr, ptr %14, align 8, !tbaa !9
  %225 = call i32 @strcmp(ptr noundef %224, ptr noundef @.str.10) #8
  %226 = icmp eq i32 %225, 0
  br i1 %226, label %227, label %229

227:                                              ; preds = %223
  %228 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 5
  store i32 1, ptr %228, align 8, !tbaa !18
  br label %363

229:                                              ; preds = %223
  %230 = load ptr, ptr %14, align 8, !tbaa !9
  %231 = call i32 @strcmp(ptr noundef %230, ptr noundef @.str.11) #8
  %232 = icmp eq i32 %231, 0
  br i1 %232, label %233, label %237

233:                                              ; preds = %229
  %234 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 5
  store i32 7, ptr %234, align 8, !tbaa !18
  %235 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 9
  %236 = getelementptr inbounds [20 x i8], ptr %235, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %236, ptr align 1 @.str.12, i64 2, i1 false)
  br label %362

237:                                              ; preds = %229
  %238 = load ptr, ptr %14, align 8, !tbaa !9
  %239 = call i32 @strcmp(ptr noundef %238, ptr noundef @.str) #8
  %240 = icmp eq i32 %239, 0
  br i1 %240, label %241, label %263

241:                                              ; preds = %237
  %242 = load i32, ptr %10, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %10, align 4, !tbaa !5
  %244 = load i32, ptr %10, align 4, !tbaa !5
  %245 = load i32, ptr %4, align 4, !tbaa !5
  %246 = icmp sge i32 %244, %245
  br i1 %246, label %247, label %254

247:                                              ; preds = %241
  %248 = load ptr, ptr @stderr, align 8, !tbaa !9
  %249 = load ptr, ptr @Argv0, align 8, !tbaa !9
  %250 = load ptr, ptr %14, align 8, !tbaa !9
  %251 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %248, ptr noundef @.str.13, ptr noundef %249, ptr noundef %250) #7
  %252 = load ptr, ptr @stderr, align 8, !tbaa !9
  %253 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %252, ptr noundef @.str.6) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %368

254:                                              ; preds = %241
  %255 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 9
  %256 = getelementptr inbounds [20 x i8], ptr %255, i64 0, i64 0
  %257 = load ptr, ptr %5, align 8, !tbaa !9
  %258 = load i32, ptr %10, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds ptr, ptr %257, i64 %259
  %261 = load ptr, ptr %260, align 8, !tbaa !9
  %262 = call ptr (i32, ptr, ptr, ...) @sqlite3_snprintf(i32 noundef 20, ptr noundef %256, ptr noundef @.str.14, i32 noundef 19, ptr noundef %261)
  br label %361

263:                                              ; preds = %237
  %264 = load ptr, ptr %14, align 8, !tbaa !9
  %265 = call i32 @strcmp(ptr noundef %264, ptr noundef @.str.1) #8
  %266 = icmp eq i32 %265, 0
  br i1 %266, label %267, label %289

267:                                              ; preds = %263
  %268 = load i32, ptr %10, align 4, !tbaa !5
  %269 = add nsw i32 %268, 1
  store i32 %269, ptr %10, align 4, !tbaa !5
  %270 = load i32, ptr %10, align 4, !tbaa !5
  %271 = load i32, ptr %4, align 4, !tbaa !5
  %272 = icmp sge i32 %270, %271
  br i1 %272, label %273, label %280

273:                                              ; preds = %267
  %274 = load ptr, ptr @stderr, align 8, !tbaa !9
  %275 = load ptr, ptr @Argv0, align 8, !tbaa !9
  %276 = load ptr, ptr %14, align 8, !tbaa !9
  %277 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %274, ptr noundef @.str.13, ptr noundef %275, ptr noundef %276) #7
  %278 = load ptr, ptr @stderr, align 8, !tbaa !9
  %279 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %278, ptr noundef @.str.6) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %368

280:                                              ; preds = %267
  %281 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 12
  %282 = getelementptr inbounds [20 x i8], ptr %281, i64 0, i64 0
  %283 = load ptr, ptr %5, align 8, !tbaa !9
  %284 = load i32, ptr %10, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds ptr, ptr %283, i64 %285
  %287 = load ptr, ptr %286, align 8, !tbaa !9
  %288 = call ptr (i32, ptr, ptr, ...) @sqlite3_snprintf(i32 noundef 20, ptr noundef %282, ptr noundef @.str.14, i32 noundef 19, ptr noundef %287)
  br label %360

289:                                              ; preds = %263
  %290 = load ptr, ptr %14, align 8, !tbaa !9
  %291 = call i32 @strcmp(ptr noundef %290, ptr noundef @.str.15) #8
  %292 = icmp eq i32 %291, 0
  br i1 %292, label %293, label %295

293:                                              ; preds = %289
  %294 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 7
  store i32 1, ptr %294, align 8, !tbaa !19
  br label %359

295:                                              ; preds = %289
  %296 = load ptr, ptr %14, align 8, !tbaa !9
  %297 = call i32 @strcmp(ptr noundef %296, ptr noundef @.str.16) #8
  %298 = icmp eq i32 %297, 0
  br i1 %298, label %299, label %301

299:                                              ; preds = %295
  %300 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 7
  store i32 0, ptr %300, align 8, !tbaa !19
  br label %358

301:                                              ; preds = %295
  %302 = load ptr, ptr %14, align 8, !tbaa !9
  %303 = call i32 @strcmp(ptr noundef %302, ptr noundef @.str.17) #8
  %304 = icmp eq i32 %303, 0
  br i1 %304, label %305, label %307

305:                                              ; preds = %301
  %306 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 1
  store i32 1, ptr %306, align 8, !tbaa !20
  br label %357

307:                                              ; preds = %301
  %308 = load ptr, ptr %14, align 8, !tbaa !9
  %309 = call i32 @strcmp(ptr noundef %308, ptr noundef @.str.18) #8
  %310 = icmp eq i32 %309, 0
  br i1 %310, label %311, label %313

311:                                              ; preds = %307
  %312 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 2
  store i32 1, ptr %312, align 4, !tbaa !21
  br label %356

313:                                              ; preds = %307
  %314 = load ptr, ptr %14, align 8, !tbaa !9
  %315 = call i32 @strcmp(ptr noundef %314, ptr noundef @.str.19) #8
  %316 = icmp eq i32 %315, 0
  br i1 %316, label %317, label %318

317:                                              ; preds = %313
  store i32 1, ptr @bail_on_error, align 4, !tbaa !5
  br label %355

318:                                              ; preds = %313
  %319 = load ptr, ptr %14, align 8, !tbaa !9
  %320 = call i32 @strcmp(ptr noundef %319, ptr noundef @.str.20) #8
  %321 = icmp eq i32 %320, 0
  br i1 %321, label %322, label %325

322:                                              ; preds = %318
  %323 = call ptr @sqlite3_libversion()
  %324 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, ptr noundef %323)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %368

325:                                              ; preds = %318
  %326 = load ptr, ptr %14, align 8, !tbaa !9
  %327 = call i32 @strcmp(ptr noundef %326, ptr noundef @.str.22) #8
  %328 = icmp eq i32 %327, 0
  br i1 %328, label %329, label %330

329:                                              ; preds = %325
  store i32 1, ptr @stdin_is_interactive, align 4, !tbaa !5
  br label %353

330:                                              ; preds = %325
  %331 = load ptr, ptr %14, align 8, !tbaa !9
  %332 = call i32 @strcmp(ptr noundef %331, ptr noundef @.str.3) #8
  %333 = icmp eq i32 %332, 0
  br i1 %333, label %334, label %335

334:                                              ; preds = %330
  store i32 0, ptr @stdin_is_interactive, align 4, !tbaa !5
  br label %352

335:                                              ; preds = %330
  %336 = load ptr, ptr %14, align 8, !tbaa !9
  %337 = call i32 @strcmp(ptr noundef %336, ptr noundef @.str.23) #8
  %338 = icmp eq i32 %337, 0
  br i1 %338, label %343, label %339

339:                                              ; preds = %335
  %340 = load ptr, ptr %14, align 8, !tbaa !9
  %341 = call i32 @strcmp(ptr noundef %340, ptr noundef @.str.24) #8
  %342 = icmp eq i32 %341, 0
  br i1 %342, label %343, label %344

343:                                              ; preds = %339, %335
  call void @usage(i32 noundef 1)
  br label %351

344:                                              ; preds = %339
  %345 = load ptr, ptr @stderr, align 8, !tbaa !9
  %346 = load ptr, ptr @Argv0, align 8, !tbaa !9
  %347 = load ptr, ptr %14, align 8, !tbaa !9
  %348 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %345, ptr noundef @.str.25, ptr noundef %346, ptr noundef %347) #7
  %349 = load ptr, ptr @stderr, align 8, !tbaa !9
  %350 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %349, ptr noundef @.str.6) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %368

351:                                              ; preds = %343
  br label %352

352:                                              ; preds = %351, %334
  br label %353

353:                                              ; preds = %352, %329
  br label %354

354:                                              ; preds = %353
  br label %355

355:                                              ; preds = %354, %317
  br label %356

356:                                              ; preds = %355, %311
  br label %357

357:                                              ; preds = %356, %305
  br label %358

358:                                              ; preds = %357, %299
  br label %359

359:                                              ; preds = %358, %293
  br label %360

360:                                              ; preds = %359, %280
  br label %361

361:                                              ; preds = %360, %254
  br label %362

362:                                              ; preds = %361, %233
  br label %363

363:                                              ; preds = %362, %227
  br label %364

364:                                              ; preds = %363, %221
  br label %365

365:                                              ; preds = %364, %215
  br label %366

366:                                              ; preds = %365, %209
  br label %367

367:                                              ; preds = %366, %202
  store i32 0, ptr %13, align 4
  br label %368

368:                                              ; preds = %367, %344, %322, %273, %247
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %369 = load i32, ptr %13, align 4
  switch i32 %369, label %469 [
    i32 0, label %370
  ]

370:                                              ; preds = %368
  br label %371

371:                                              ; preds = %370
  %372 = load i32, ptr %10, align 4, !tbaa !5
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %10, align 4, !tbaa !5
  br label %168, !llvm.loop !22

374:                                              ; preds = %182
  %375 = load ptr, ptr %9, align 8, !tbaa !9
  %376 = icmp ne ptr %375, null
  br i1 %376, label %377, label %415

377:                                              ; preds = %374
  %378 = load ptr, ptr %9, align 8, !tbaa !9
  %379 = getelementptr inbounds i8, ptr %378, i64 0
  %380 = load i8, ptr %379, align 1, !tbaa !11
  %381 = sext i8 %380 to i32
  %382 = icmp eq i32 %381, 46
  br i1 %382, label %383, label %386

383:                                              ; preds = %377
  %384 = load ptr, ptr %9, align 8, !tbaa !9
  %385 = call i32 @do_meta_command(ptr noundef %384, ptr noundef %7)
  store i32 %385, ptr %11, align 4, !tbaa !5
  br label %414

386:                                              ; preds = %377
  call void @open_db(ptr noundef %7)
  %387 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 0
  %388 = load ptr, ptr %387, align 8, !tbaa !23
  %389 = load ptr, ptr %9, align 8, !tbaa !9
  %390 = call i32 @shell_exec(ptr noundef %388, ptr noundef %389, ptr noundef @shell_callback, ptr noundef %7, ptr noundef %6)
  store i32 %390, ptr %11, align 4, !tbaa !5
  %391 = load ptr, ptr %6, align 8, !tbaa !9
  %392 = icmp ne ptr %391, null
  br i1 %392, label %393, label %404

393:                                              ; preds = %386
  %394 = load ptr, ptr @stderr, align 8, !tbaa !9
  %395 = load ptr, ptr %6, align 8, !tbaa !9
  %396 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %394, ptr noundef @.str.26, ptr noundef %395) #7
  %397 = load i32, ptr %11, align 4, !tbaa !5
  %398 = icmp ne i32 %397, 0
  br i1 %398, label %399, label %401

399:                                              ; preds = %393
  %400 = load i32, ptr %11, align 4, !tbaa !5
  br label %402

401:                                              ; preds = %393
  br label %402

402:                                              ; preds = %401, %399
  %403 = phi i32 [ %400, %399 ], [ 1, %401 ]
  store i32 %403, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %469

404:                                              ; preds = %386
  %405 = load i32, ptr %11, align 4, !tbaa !5
  %406 = icmp ne i32 %405, 0
  br i1 %406, label %407, label %412

407:                                              ; preds = %404
  %408 = load ptr, ptr @stderr, align 8, !tbaa !9
  %409 = load ptr, ptr %9, align 8, !tbaa !9
  %410 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %408, ptr noundef @.str.27, ptr noundef %409) #7
  %411 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %411, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %469

412:                                              ; preds = %404
  br label %413

413:                                              ; preds = %412
  br label %414

414:                                              ; preds = %413, %383
  br label %450

415:                                              ; preds = %374
  %416 = load i32, ptr @stdin_is_interactive, align 4, !tbaa !5
  %417 = icmp ne i32 %416, 0
  br i1 %417, label %418, label %446

418:                                              ; preds = %415
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr null, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %419 = call ptr @sqlite3_libversion()
  %420 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, ptr noundef %419)
  %421 = call ptr @find_home_dir()
  store ptr %421, ptr %15, align 8, !tbaa !9
  %422 = load ptr, ptr %15, align 8, !tbaa !9
  %423 = icmp ne ptr %422, null
  br i1 %423, label %424, label %438

424:                                              ; preds = %418
  %425 = load ptr, ptr %15, align 8, !tbaa !9
  %426 = call i32 @strlen30(ptr noundef %425)
  %427 = add nsw i32 %426, 20
  store i32 %427, ptr %17, align 4, !tbaa !5
  %428 = load i32, ptr %17, align 4, !tbaa !5
  %429 = sext i32 %428 to i64
  %430 = call noalias ptr @malloc(i64 noundef %429) #9
  store ptr %430, ptr %16, align 8, !tbaa !9
  %431 = icmp ne ptr %430, null
  br i1 %431, label %432, label %437

432:                                              ; preds = %424
  %433 = load i32, ptr %17, align 4, !tbaa !5
  %434 = load ptr, ptr %16, align 8, !tbaa !9
  %435 = load ptr, ptr %15, align 8, !tbaa !9
  %436 = call ptr (i32, ptr, ptr, ...) @sqlite3_snprintf(i32 noundef %433, ptr noundef %434, ptr noundef @.str.29, ptr noundef %435)
  br label %437

437:                                              ; preds = %432, %424
  br label %438

438:                                              ; preds = %437, %418
  %439 = call i32 @process_input(ptr noundef %7, ptr noundef null)
  store i32 %439, ptr %11, align 4, !tbaa !5
  %440 = load ptr, ptr %16, align 8, !tbaa !9
  %441 = icmp ne ptr %440, null
  br i1 %441, label %442, label %444

442:                                              ; preds = %438
  %443 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free(ptr noundef %443) #7
  br label %444

444:                                              ; preds = %442, %438
  %445 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %445) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %449

446:                                              ; preds = %415
  %447 = load ptr, ptr @stdin, align 8, !tbaa !9
  %448 = call i32 @process_input(ptr noundef %7, ptr noundef %447)
  store i32 %448, ptr %11, align 4, !tbaa !5
  br label %449

449:                                              ; preds = %446, %444
  br label %450

450:                                              ; preds = %449, %414
  call void @set_table_name(ptr noundef %7, ptr noundef null)
  %451 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 0
  %452 = load ptr, ptr %451, align 8, !tbaa !23
  %453 = icmp ne ptr %452, null
  br i1 %453, label %454, label %467

454:                                              ; preds = %450
  %455 = getelementptr inbounds %struct.callback_data, ptr %7, i32 0, i32 0
  %456 = load ptr, ptr %455, align 8, !tbaa !23
  %457 = call i32 @sqlite3_close(ptr noundef %456)
  %458 = icmp ne i32 %457, 0
  br i1 %458, label %459, label %466

459:                                              ; preds = %454
  %460 = load ptr, ptr @stderr, align 8, !tbaa !9
  %461 = load ptr, ptr @db, align 8, !tbaa !9
  %462 = call ptr @sqlite3_errmsg(ptr noundef %461)
  %463 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %460, ptr noundef @.str.30, ptr noundef %462) #7
  %464 = load i32, ptr %11, align 4, !tbaa !5
  %465 = add nsw i32 %464, 1
  store i32 %465, ptr %11, align 4, !tbaa !5
  br label %466

466:                                              ; preds = %459, %454
  br label %467

467:                                              ; preds = %466, %450
  %468 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %468, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %469

469:                                              ; preds = %467, %407, %402, %368, %165, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 5432, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %470 = load i32, ptr %3, align 4
  ret i32 %470

471:                                              ; preds = %106
  unreachable
}

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

; Function Attrs: nounwind uwtable
declare hidden void @main_init(ptr noundef) #0

; Function Attrs: nounwind
declare i32 @isatty(i32 noundef) #2

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @interrupt_handler(i32 noundef) #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @open_db(ptr noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare ptr @sqlite3_snprintf(i32 noundef, ptr noundef, ptr noundef, ...) #5

declare i32 @printf(ptr noundef, ...) #5

declare ptr @sqlite3_libversion() #5

; Function Attrs: nounwind uwtable
declare hidden void @usage(i32 noundef) #0

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @find_home_dir() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @strlen30(ptr noundef) #0

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

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

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

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

declare i32 @sqlite3_close(ptr noundef) #5

declare ptr @sqlite3_errmsg(ptr noundef) #5

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !10, i64 5408}
!15 = !{!"callback_data", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !10, i64 48, !7, i64 56, !7, i64 76, !7, i64 476, !7, i64 876, !16, i64 896, !7, i64 1308, !10, i64 5408, !10, i64 5416, !10, i64 5424}
!16 = !{!"previous_mode_data", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 12}
!17 = !{!15, !10, i64 24}
!18 = !{!15, !6, i64 32}
!19 = !{!15, !6, i64 40}
!20 = !{!15, !6, i64 8}
!21 = !{!15, !6, i64 12}
!22 = distinct !{!22, !13}
!23 = !{!15, !10, i64 0}


; 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.callback_data = type { ptr, i32, i32, i32, ptr, i32, i32, i32, ptr, [20 x i8], [100 x i32], [100 x i32], [20 x i8], %struct.previous_mode_data, [4096 x i8], ptr, ptr, ptr }
%struct.previous_mode_data = type { i32, i32, i32, [100 x i32] }

@Argv0 = external hidden local_unnamed_addr global ptr, align 8
@stdin_is_interactive = external hidden local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [34 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [6 x i8], align 1
@bail_on_error = external hidden local_unnamed_addr global i32, align 4
@.str.20 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [19 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.30 = external hidden unnamed_addr constant [35 x i8], align 1
@db = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca %struct.callback_data, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 5432, ptr nonnull %4) #9
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  store ptr %5, ptr @Argv0, align 8, !tbaa !5
  call void @main_init(ptr noundef nonnull %4)
  %6 = call i32 @isatty(i32 noundef 0) #9
  store i32 %6, ptr @stdin_is_interactive, align 4, !tbaa !9
  %7 = call ptr @signal(i32 noundef 2, ptr noundef nonnull @interrupt_handler) #9
  %8 = add nsw i32 %0, -1
  %9 = icmp sgt i32 %0, 2
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %34
  %.0102161 = phi ptr [ %.2104.ph, %34 ], [ null, %2 ]
  %.0110160 = phi i32 [ %35, %34 ], [ 1, %2 ]
  %10 = sext i32 %.0110160 to i64
  %11 = getelementptr inbounds ptr, ptr %1, i64 %10
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = load i8, ptr %12, align 1, !tbaa !11
  %.not = icmp eq i8 %13, 45
  br i1 %.not, label %14, label %._crit_edge

14:                                               ; preds = %.lr.ph
  %15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str) #10
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %20, label %17

17:                                               ; preds = %14
  %18 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str.1) #10
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %17, %14
  %21 = add nsw i32 %.0110160, 1
  br label %34

22:                                               ; preds = %17
  %23 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str.2) #10
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = add nsw i32 %.0110160, 1
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %1, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  br label %34

30:                                               ; preds = %22
  %31 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str.3) #10
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store i32 0, ptr @stdin_is_interactive, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %25, %33, %30, %20
  %.2112.ph = phi i32 [ %.0110160, %30 ], [ %.0110160, %33 ], [ %26, %25 ], [ %21, %20 ]
  %.2104.ph = phi ptr [ %.0102161, %30 ], [ %.0102161, %33 ], [ %29, %25 ], [ %.0102161, %20 ]
  %35 = add nsw i32 %.2112.ph, 1
  %36 = icmp slt i32 %35, %8
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %34, %.lr.ph, %2
  %.0110.lcssa = phi i32 [ 1, %2 ], [ %.0110160, %.lr.ph ], [ %35, %34 ]
  %.0102.lcssa = phi ptr [ null, %2 ], [ %.0102161, %.lr.ph ], [ %.2104.ph, %34 ]
  %37 = icmp slt i32 %.0110.lcssa, %0
  br i1 %37, label %38, label %43

38:                                               ; preds = %._crit_edge
  %39 = add nsw i32 %.0110.lcssa, 1
  %40 = sext i32 %.0110.lcssa to i64
  %41 = getelementptr inbounds ptr, ptr %1, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %._crit_edge, %38
  %44 = phi ptr [ %42, %38 ], [ @.str.4, %._crit_edge ]
  %.4 = phi i32 [ %39, %38 ], [ %.0110.lcssa, %._crit_edge ]
  %45 = getelementptr inbounds i8, ptr %4, i64 5408
  store ptr %44, ptr %45, align 8
  %46 = icmp slt i32 %.4, %0
  br i1 %46, label %47, label %52

47:                                               ; preds = %43
  %48 = add nsw i32 %.4, 1
  %49 = sext i32 %.4 to i64
  %50 = getelementptr inbounds ptr, ptr %1, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %47, %43
  %.0114 = phi ptr [ %51, %47 ], [ null, %43 ]
  %.5 = phi i32 [ %48, %47 ], [ %.4, %43 ]
  %53 = icmp slt i32 %.5, %0
  br i1 %53, label %54, label %63

54:                                               ; preds = %52
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = load ptr, ptr @Argv0, align 8, !tbaa !5
  %57 = sext i32 %.5 to i64
  %58 = getelementptr inbounds ptr, ptr %1, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.5, ptr noundef %56, ptr noundef %59) #11
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.6) #11
  br label %243

63:                                               ; preds = %52
  %64 = load ptr, ptr @stdout, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr %64, ptr %65, align 8, !tbaa !14
  %66 = call i32 @access(ptr noundef %44, i32 noundef 0) #9
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %63
  call void @open_db(ptr noundef nonnull %4)
  br label %69

69:                                               ; preds = %68, %63
  %70 = call i32 @process_sqliterc(ptr noundef nonnull %4, ptr noundef %.0102.lcssa)
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %243, label %.preheader

.preheader:                                       ; preds = %69
  %72 = icmp sgt i32 %0, 1
  br i1 %72, label %.lr.ph167, label %.critedge

.lr.ph167:                                        ; preds = %.preheader
  %73 = getelementptr inbounds i8, ptr %4, i64 12
  %74 = getelementptr inbounds i8, ptr %4, i64 8
  %75 = getelementptr inbounds i8, ptr %4, i64 40
  %76 = getelementptr inbounds i8, ptr %4, i64 876
  %77 = getelementptr inbounds i8, ptr %4, i64 56
  %78 = getelementptr inbounds i8, ptr %4, i64 32
  %79 = load i16, ptr @.str.12, align 1
  br label %80

80:                                               ; preds = %.lr.ph167, %193
  %.6166 = phi i32 [ 1, %.lr.ph167 ], [ %194, %193 ]
  %81 = sext i32 %.6166 to i64
  %82 = getelementptr inbounds ptr, ptr %1, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = icmp eq i8 %84, 45
  br i1 %85, label %86, label %.critedge

86:                                               ; preds = %80
  %87 = getelementptr inbounds i8, ptr %83, i64 1
  %88 = load i8, ptr %87, align 1, !tbaa !11
  %89 = icmp eq i8 %88, 45
  %spec.select = select i1 %89, ptr %87, ptr %83
  %90 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.2) #10
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %86
  %93 = add nsw i32 %.6166, 1
  br label %193

94:                                               ; preds = %86
  %95 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.7) #10
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  store i32 4, ptr %78, align 8, !tbaa !17
  br label %193

98:                                               ; preds = %94
  %99 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.8) #10
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %98
  store i32 2, ptr %78, align 8, !tbaa !17
  br label %193

102:                                              ; preds = %98
  %103 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.9) #10
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %102
  store i32 0, ptr %78, align 8, !tbaa !17
  br label %193

106:                                              ; preds = %102
  %107 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.10) #10
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  store i32 1, ptr %78, align 8, !tbaa !17
  br label %193

110:                                              ; preds = %106
  %111 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.11) #10
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %110
  store i32 7, ptr %78, align 8, !tbaa !17
  store i16 %79, ptr %77, align 8
  br label %193

114:                                              ; preds = %110
  %115 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str) #10
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %130

117:                                              ; preds = %114
  %118 = add nsw i32 %.6166, 1
  %.not139 = icmp slt i32 %118, %0
  br i1 %.not139, label %125, label %119

119:                                              ; preds = %117
  %120 = load ptr, ptr @stderr, align 8, !tbaa !5
  %121 = load ptr, ptr @Argv0, align 8, !tbaa !5
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef nonnull @.str.13, ptr noundef %121, ptr noundef nonnull %spec.select) #11
  %123 = load ptr, ptr @stderr, align 8, !tbaa !5
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef nonnull @.str.6) #11
  br label %243

125:                                              ; preds = %117
  %126 = sext i32 %118 to i64
  %127 = getelementptr inbounds ptr, ptr %1, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = call ptr (i32, ptr, ptr, ...) @sqlite3_snprintf(i32 noundef 20, ptr noundef nonnull %77, ptr noundef nonnull @.str.14, i32 noundef 19, ptr noundef %128) #9
  br label %193

130:                                              ; preds = %114
  %131 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.1) #10
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %146

133:                                              ; preds = %130
  %134 = add nsw i32 %.6166, 1
  %.not138 = icmp slt i32 %134, %0
  br i1 %.not138, label %141, label %135

135:                                              ; preds = %133
  %136 = load ptr, ptr @stderr, align 8, !tbaa !5
  %137 = load ptr, ptr @Argv0, align 8, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef nonnull @.str.13, ptr noundef %137, ptr noundef nonnull %spec.select) #11
  %139 = load ptr, ptr @stderr, align 8, !tbaa !5
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef nonnull @.str.6) #11
  br label %243

141:                                              ; preds = %133
  %142 = sext i32 %134 to i64
  %143 = getelementptr inbounds ptr, ptr %1, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = call ptr (i32, ptr, ptr, ...) @sqlite3_snprintf(i32 noundef 20, ptr noundef nonnull %76, ptr noundef nonnull @.str.14, i32 noundef 19, ptr noundef %144) #9
  br label %193

146:                                              ; preds = %130
  %147 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.15) #10
  %148 = icmp eq i32 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %146
  store i32 1, ptr %75, align 8, !tbaa !18
  br label %193

150:                                              ; preds = %146
  %151 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.16) #10
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %150
  store i32 0, ptr %75, align 8, !tbaa !18
  br label %193

154:                                              ; preds = %150
  %155 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.17) #10
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %154
  store i32 1, ptr %74, align 8, !tbaa !19
  br label %193

158:                                              ; preds = %154
  %159 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.18) #10
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %162

161:                                              ; preds = %158
  store i32 1, ptr %73, align 4, !tbaa !20
  br label %193

162:                                              ; preds = %158
  %163 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.19) #10
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %162
  store i32 1, ptr @bail_on_error, align 4, !tbaa !9
  br label %193

166:                                              ; preds = %162
  %167 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.20) #10
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %172

169:                                              ; preds = %166
  %170 = call ptr @sqlite3_libversion() #9
  %171 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef %170)
  br label %243

172:                                              ; preds = %166
  %173 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.22) #10
  %174 = icmp eq i32 %173, 0
  br i1 %174, label %175, label %176

175:                                              ; preds = %172
  store i32 1, ptr @stdin_is_interactive, align 4, !tbaa !9
  br label %193

176:                                              ; preds = %172
  %177 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.3) #10
  %178 = icmp eq i32 %177, 0
  br i1 %178, label %179, label %180

179:                                              ; preds = %176
  store i32 0, ptr @stdin_is_interactive, align 4, !tbaa !9
  br label %193

180:                                              ; preds = %176
  %181 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.23) #10
  %182 = icmp eq i32 %181, 0
  br i1 %182, label %186, label %183

183:                                              ; preds = %180
  %184 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.select, ptr noundef nonnull dereferenceable(1) @.str.24) #10
  %185 = icmp eq i32 %184, 0
  br i1 %185, label %186, label %187

186:                                              ; preds = %183, %180
  call void @usage(i32 noundef 1)
  br label %193

187:                                              ; preds = %183
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = load ptr, ptr @Argv0, align 8, !tbaa !5
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef nonnull @.str.25, ptr noundef %189, ptr noundef nonnull %spec.select) #11
  %191 = load ptr, ptr @stderr, align 8, !tbaa !5
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef nonnull @.str.6) #11
  br label %243

193:                                              ; preds = %97, %105, %113, %141, %153, %161, %179, %186, %175, %165, %157, %149, %125, %109, %101, %92
  %.8.ph = phi i32 [ %.6166, %186 ], [ %.6166, %179 ], [ %.6166, %175 ], [ %.6166, %165 ], [ %.6166, %161 ], [ %.6166, %157 ], [ %.6166, %153 ], [ %.6166, %149 ], [ %134, %141 ], [ %118, %125 ], [ %.6166, %113 ], [ %.6166, %109 ], [ %.6166, %105 ], [ %.6166, %101 ], [ %.6166, %97 ], [ %93, %92 ]
  %194 = add nsw i32 %.8.ph, 1
  %195 = icmp slt i32 %194, %0
  br i1 %195, label %80, label %.critedge, !llvm.loop !21

.critedge:                                        ; preds = %80, %193, %.preheader
  %.not128 = icmp eq ptr %.0114, null
  br i1 %.not128, label %213, label %196

196:                                              ; preds = %.critedge
  %197 = load i8, ptr %.0114, align 1, !tbaa !11
  %198 = icmp eq i8 %197, 46
  br i1 %198, label %199, label %201

199:                                              ; preds = %196
  %200 = call i32 @do_meta_command(ptr noundef nonnull %.0114, ptr noundef nonnull %4)
  br label %233

201:                                              ; preds = %196
  call void @open_db(ptr noundef nonnull %4)
  %202 = load ptr, ptr %4, align 8, !tbaa !22
  %203 = call i32 @shell_exec(ptr noundef %202, ptr noundef nonnull %.0114, ptr noundef nonnull @shell_callback, ptr noundef nonnull %4, ptr noundef nonnull %3)
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %.not133 = icmp eq ptr %204, null
  br i1 %.not133, label %209, label %205

205:                                              ; preds = %201
  %206 = load ptr, ptr @stderr, align 8, !tbaa !5
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef nonnull @.str.26, ptr noundef nonnull %204) #11
  %208 = call i32 @llvm.umax.i32(i32 %203, i32 1)
  br label %243

209:                                              ; preds = %201
  %.not134 = icmp eq i32 %203, 0
  br i1 %.not134, label %233, label %210

210:                                              ; preds = %209
  %211 = load ptr, ptr @stderr, align 8, !tbaa !5
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %211, ptr noundef nonnull @.str.27, ptr noundef nonnull %.0114) #11
  br label %243

213:                                              ; preds = %.critedge
  %214 = load i32, ptr @stdin_is_interactive, align 4, !tbaa !9
  %.not129 = icmp eq i32 %214, 0
  br i1 %.not129, label %230, label %215

215:                                              ; preds = %213
  %216 = call ptr @sqlite3_libversion() #9
  %217 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, ptr noundef %216)
  %218 = call ptr @find_home_dir()
  %.not130 = icmp eq ptr %218, null
  br i1 %.not130, label %.thread154, label %219

219:                                              ; preds = %215
  %220 = call i32 @strlen30(ptr noundef nonnull %218)
  %221 = add nsw i32 %220, 20
  %222 = sext i32 %221 to i64
  %223 = call noalias ptr @malloc(i64 noundef %222) #12
  %.not131 = icmp eq ptr %223, null
  br i1 %.not131, label %.thread154, label %225

.thread154:                                       ; preds = %219, %215
  %224 = call i32 @process_input(ptr noundef nonnull %4, ptr noundef null)
  br label %228

225:                                              ; preds = %219
  %226 = call ptr (i32, ptr, ptr, ...) @sqlite3_snprintf(i32 noundef %221, ptr noundef nonnull %223, ptr noundef nonnull @.str.29, ptr noundef nonnull %218) #9
  %227 = call i32 @process_input(ptr noundef nonnull %4, ptr noundef null)
  call void @free(ptr noundef nonnull %223) #9
  br label %228

228:                                              ; preds = %.thread154, %225
  %229 = phi i32 [ %224, %.thread154 ], [ %227, %225 ]
  call void @free(ptr noundef %218) #9
  br label %233

230:                                              ; preds = %213
  %231 = load ptr, ptr @stdin, align 8, !tbaa !5
  %232 = call i32 @process_input(ptr noundef nonnull %4, ptr noundef %231)
  br label %233

233:                                              ; preds = %228, %230, %199, %209
  %.0108 = phi i32 [ %200, %199 ], [ 0, %209 ], [ %229, %228 ], [ %232, %230 ]
  call void @set_table_name(ptr noundef nonnull %4, ptr noundef null)
  %234 = load ptr, ptr %4, align 8, !tbaa !22
  %.not136 = icmp eq ptr %234, null
  br i1 %.not136, label %243, label %235

235:                                              ; preds = %233
  %236 = call i32 @sqlite3_close(ptr noundef nonnull %234) #9
  %.not137 = icmp eq i32 %236, 0
  br i1 %.not137, label %243, label %237

237:                                              ; preds = %235
  %238 = load ptr, ptr @stderr, align 8, !tbaa !5
  %239 = load ptr, ptr @db, align 8, !tbaa !5
  %240 = call ptr @sqlite3_errmsg(ptr noundef %239) #9
  %241 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %238, ptr noundef nonnull @.str.30, ptr noundef %240) #11
  %242 = add nsw i32 %.0108, 1
  br label %243

243:                                              ; preds = %119, %135, %169, %187, %233, %237, %235, %69, %210, %205, %54
  %.2 = phi i32 [ 1, %54 ], [ %208, %205 ], [ %203, %210 ], [ %70, %69 ], [ %242, %237 ], [ %.0108, %235 ], [ %.0108, %233 ], [ 1, %119 ], [ 1, %135 ], [ 0, %169 ], [ 1, %187 ]
  call void @llvm.lifetime.end.p0(i64 5432, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  ret i32 %.2
}

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

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

; Function Attrs: nounwind
declare i32 @isatty(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare ptr @signal(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @interrupt_handler(i32 noundef) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #4

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

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

declare ptr @sqlite3_snprintf(i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

declare ptr @sqlite3_libversion() local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden void @usage(i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @find_home_dir() local_unnamed_addr #0

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

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

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

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

declare i32 @sqlite3_close(ptr noundef) local_unnamed_addr #5

declare ptr @sqlite3_errmsg(ptr noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #8

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { cold nounwind }
attributes #12 = { nounwind allocsize(0) }

!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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 24}
!15 = !{!"callback_data", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !6, i64 48, !7, i64 56, !7, i64 76, !7, i64 476, !7, i64 876, !16, i64 896, !7, i64 1308, !6, i64 5408, !6, i64 5416, !6, i64 5424}
!16 = !{!"previous_mode_data", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 12}
!17 = !{!15, !10, i64 32}
!18 = !{!15, !10, i64 40}
!19 = !{!15, !10, i64 8}
!20 = !{!15, !10, i64 12}
!21 = distinct !{!21, !13}
!22 = !{!15, !6, i64 0}


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