; LLVM IR from paintdream/DontStarveLuaJIT :: src/luajit/src/host (buildvm_lib)

; 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.LibDefHandler = type { ptr, ptr, ptr, i32 }
%struct.BuildCtx = type { ptr, i32, ptr, ptr, ptr, ptr, i64, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [200 x %struct.BuildReloc] }
%struct.BuildReloc = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [47 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@ffid = external hidden global i32, align 4
@recffid = external hidden global i32, align 4
@ffasmfunc = external hidden global i32, align 4
@stdin = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@modstate = external hidden global i32, align 4
@regfunc = external hidden global i32, align 4
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@libdef_handlers = external hidden constant [11 x %struct.LibDefHandler], align 16
@.str.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@obuf = external hidden global [8192 x i8], align 16
@.str.18 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @emit_lib(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [256 x i8], align 16
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.BuildCtx, ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = icmp eq i32 %17, 6
  br i1 %18, label %29, label %19

19:                                               ; preds = %1
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.BuildCtx, ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp eq i32 %22, 7
  br i1 %23, label %29, label %24

24:                                               ; preds = %19
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.BuildCtx, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = icmp eq i32 %27, 8
  br i1 %28, label %29, label %34

29:                                               ; preds = %24, %19, %1
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.BuildCtx, ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str) #7
  br label %45

34:                                               ; preds = %24
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.BuildCtx, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = icmp eq i32 %37, 9
  br i1 %38, label %39, label %44

39:                                               ; preds = %34
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.BuildCtx, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !13
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.1) #7
  br label %44

44:                                               ; preds = %39, %34
  br label %45

45:                                               ; preds = %44, %29
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.BuildCtx, ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = icmp eq i32 %48, 8
  br i1 %49, label %50, label %55

50:                                               ; preds = %45
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.BuildCtx, ptr %51, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !13
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.2) #7
  br label %55

55:                                               ; preds = %50, %45
  store i32 2, ptr @ffid, align 4, !tbaa !14
  store i32 2, ptr @recffid, align 4, !tbaa !14
  store i32 0, ptr @ffasmfunc, align 4, !tbaa !14
  br label %56

56:                                               ; preds = %282, %55
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.BuildCtx, ptr %57, i32 0, i32 4
  %59 = load ptr, ptr %58, align 8, !tbaa !15
  %60 = getelementptr inbounds ptr, ptr %59, i32 1
  store ptr %60, ptr %58, align 8, !tbaa !15
  %61 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %61, ptr %3, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %283

63:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 256, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 0
  %66 = load i8, ptr %65, align 1, !tbaa !16
  %67 = sext i8 %66 to i32
  %68 = icmp eq i32 %67, 45
  br i1 %68, label %69, label %77

69:                                               ; preds = %63
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 1
  %72 = load i8, ptr %71, align 1, !tbaa !16
  %73 = sext i8 %72 to i32
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %77

75:                                               ; preds = %69
  %76 = load ptr, ptr @stdin, align 8, !tbaa !5
  store ptr %76, ptr %5, align 8, !tbaa !5
  br label %90

77:                                               ; preds = %69, %63
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = call noalias ptr @fopen(ptr noundef %78, ptr noundef @.str.3)
  store ptr %79, ptr %5, align 8, !tbaa !5
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = icmp ne ptr %80, null
  br i1 %81, label %89, label %82

82:                                               ; preds = %77
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = call ptr @__errno_location() #8
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = call ptr @strerror(i32 noundef %86) #7
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.4, ptr noundef %84, ptr noundef %87) #7
  call void @exit(i32 noundef 1) #9
  unreachable

89:                                               ; preds = %77
  br label %90

90:                                               ; preds = %89, %75
  store i32 0, ptr @modstate, align 4, !tbaa !14
  store i32 0, ptr @regfunc, align 4, !tbaa !14
  br label %91

91:                                               ; preds = %272, %270, %90
  %92 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = call ptr @fgets(ptr noundef %92, i32 noundef 256, ptr noundef %93)
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %273

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %97 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %98 = load i8, ptr %97, align 16, !tbaa !16
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %99, 35
  br i1 %100, label %101, label %183

101:                                              ; preds = %96
  %102 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 1
  %103 = load i8, ptr %102, align 1, !tbaa !16
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 105
  br i1 %105, label %106, label %183

106:                                              ; preds = %101
  %107 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 2
  %108 = load i8, ptr %107, align 2, !tbaa !16
  %109 = sext i8 %108 to i32
  %110 = icmp eq i32 %109, 102
  br i1 %110, label %111, label %183

111:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !14
  %112 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %113 = call i32 @strcmp(ptr noundef %112, ptr noundef @.str.5) #10
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 0, ptr %7, align 4, !tbaa !14
  br label %128

116:                                              ; preds = %111
  %117 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %118 = call i32 @strcmp(ptr noundef %117, ptr noundef @.str.6) #10
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 1, ptr %7, align 4, !tbaa !14
  br label %127

121:                                              ; preds = %116
  %122 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %123 = call i32 @strcmp(ptr noundef %122, ptr noundef @.str.7) #10
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 1, ptr %7, align 4, !tbaa !14
  br label %126

126:                                              ; preds = %125, %121
  br label %127

127:                                              ; preds = %126, %120
  br label %128

128:                                              ; preds = %127, %115
  %129 = load i32, ptr %7, align 4, !tbaa !14
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %179, label %131

131:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !14
  br label %132

132:                                              ; preds = %177, %131
  %133 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = call ptr @fgets(ptr noundef %133, i32 noundef 256, ptr noundef %134)
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %178

137:                                              ; preds = %132
  %138 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %139 = load i8, ptr %138, align 16, !tbaa !16
  %140 = sext i8 %139 to i32
  %141 = icmp eq i32 %140, 35
  br i1 %141, label %142, label %158

142:                                              ; preds = %137
  %143 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 1
  %144 = load i8, ptr %143, align 1, !tbaa !16
  %145 = sext i8 %144 to i32
  %146 = icmp eq i32 %145, 101
  br i1 %146, label %147, label %158

147:                                              ; preds = %142
  %148 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 2
  %149 = load i8, ptr %148, align 2, !tbaa !16
  %150 = sext i8 %149 to i32
  %151 = icmp eq i32 %150, 110
  br i1 %151, label %152, label %158

152:                                              ; preds = %147
  %153 = load i32, ptr %8, align 4, !tbaa !14
  %154 = add nsw i32 %153, -1
  store i32 %154, ptr %8, align 4, !tbaa !14
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %152
  br label %178

157:                                              ; preds = %152
  br label %177

158:                                              ; preds = %147, %142, %137
  %159 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %160 = load i8, ptr %159, align 16, !tbaa !16
  %161 = sext i8 %160 to i32
  %162 = icmp eq i32 %161, 35
  br i1 %162, label %163, label %176

163:                                              ; preds = %158
  %164 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 1
  %165 = load i8, ptr %164, align 1, !tbaa !16
  %166 = sext i8 %165 to i32
  %167 = icmp eq i32 %166, 105
  br i1 %167, label %168, label %176

168:                                              ; preds = %163
  %169 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 2
  %170 = load i8, ptr %169, align 2, !tbaa !16
  %171 = sext i8 %170 to i32
  %172 = icmp eq i32 %171, 102
  br i1 %172, label %173, label %176

173:                                              ; preds = %168
  %174 = load i32, ptr %8, align 4, !tbaa !14
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %8, align 4, !tbaa !14
  br label %176

176:                                              ; preds = %173, %168, %163, %158
  br label %177

177:                                              ; preds = %176, %157
  br label %132, !llvm.loop !17

178:                                              ; preds = %156, %132
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %180

179:                                              ; preds = %128
  store i32 0, ptr %9, align 4
  br label %180

180:                                              ; preds = %179, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  %181 = load i32, ptr %9, align 4
  switch i32 %181, label %270 [
    i32 0, label %182
  ]

182:                                              ; preds = %180
  br label %183

183:                                              ; preds = %182, %106, %101, %96
  %184 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  store ptr %184, ptr %6, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %268, %183
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = call ptr @strstr(ptr noundef %186, ptr noundef @.str.8) #10
  store ptr %187, ptr %6, align 8, !tbaa !5
  %188 = icmp ne ptr %187, null
  br i1 %188, label %189, label %269

189:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds i8, ptr %190, i64 6
  store ptr %191, ptr %6, align 8, !tbaa !5
  store ptr @libdef_handlers, ptr %10, align 8, !tbaa !5
  br label %192

192:                                              ; preds = %252, %189
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.LibDefHandler, ptr %193, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8, !tbaa !19
  %196 = icmp ne ptr %195, null
  br i1 %196, label %197, label %255

197:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %198 = load ptr, ptr %10, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.LibDefHandler, ptr %198, i32 0, i32 0
  %200 = load ptr, ptr %199, align 8, !tbaa !19
  %201 = call i64 @strlen(ptr noundef %200) #10
  store i64 %201, ptr %12, align 8, !tbaa !21
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = load ptr, ptr %10, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.LibDefHandler, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !19
  %206 = load i64, ptr %12, align 8, !tbaa !21
  %207 = call i32 @strncmp(ptr noundef %202, ptr noundef %205, i64 noundef %206) #10
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %248, label %209

209:                                              ; preds = %197
  %210 = load i64, ptr %12, align 8, !tbaa !21
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds i8, ptr %211, i64 %210
  store ptr %212, ptr %6, align 8, !tbaa !5
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.LibDefHandler, ptr %213, i32 0, i32 1
  %215 = load ptr, ptr %214, align 8, !tbaa !22
  %216 = icmp ne ptr %215, null
  br i1 %216, label %217, label %223

217:                                              ; preds = %209
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.LibDefHandler, ptr %219, i32 0, i32 1
  %221 = load ptr, ptr %220, align 8, !tbaa !22
  %222 = call i64 @strcspn(ptr noundef %218, ptr noundef %221) #10
  br label %224

223:                                              ; preds = %209
  br label %224

224:                                              ; preds = %223, %217
  %225 = phi i64 [ %222, %217 ], [ 0, %223 ]
  store i64 %225, ptr %11, align 8, !tbaa !21
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = load i64, ptr %11, align 8, !tbaa !21
  %228 = getelementptr inbounds i8, ptr %226, i64 %227
  %229 = load i8, ptr %228, align 1, !tbaa !16
  %230 = icmp ne i8 %229, 0
  br i1 %230, label %232, label %231

231:                                              ; preds = %224
  store i32 10, ptr %9, align 4
  br label %249

232:                                              ; preds = %224
  %233 = load ptr, ptr %6, align 8, !tbaa !5
  %234 = load i64, ptr %11, align 8, !tbaa !21
  %235 = getelementptr inbounds i8, ptr %233, i64 %234
  store i8 0, ptr %235, align 1, !tbaa !16
  %236 = load ptr, ptr %10, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.LibDefHandler, ptr %236, i32 0, i32 2
  %238 = load ptr, ptr %237, align 8, !tbaa !23
  %239 = load ptr, ptr %2, align 8, !tbaa !5
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = load ptr, ptr %10, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.LibDefHandler, ptr %241, i32 0, i32 3
  %243 = load i32, ptr %242, align 8, !tbaa !24
  call void %238(ptr noundef %239, ptr noundef %240, i32 noundef %243)
  %244 = load i64, ptr %11, align 8, !tbaa !21
  %245 = add i64 %244, 1
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  %247 = getelementptr inbounds i8, ptr %246, i64 %245
  store ptr %247, ptr %6, align 8, !tbaa !5
  store i32 10, ptr %9, align 4
  br label %249

248:                                              ; preds = %197
  store i32 0, ptr %9, align 4
  br label %249

249:                                              ; preds = %248, %232, %231
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %250 = load i32, ptr %9, align 4
  switch i32 %250, label %382 [
    i32 0, label %251
    i32 10, label %255
  ]

251:                                              ; preds = %249
  br label %252

252:                                              ; preds = %251
  %253 = load ptr, ptr %10, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.LibDefHandler, ptr %253, i32 1
  store ptr %254, ptr %10, align 8, !tbaa !5
  br label %192, !llvm.loop !25

255:                                              ; preds = %249, %192
  %256 = load ptr, ptr %10, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.LibDefHandler, ptr %256, i32 0, i32 0
  %258 = load ptr, ptr %257, align 8, !tbaa !19
  %259 = icmp eq ptr %258, null
  br i1 %259, label %260, label %268

260:                                              ; preds = %255
  %261 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 0
  %262 = call i64 @strlen(ptr noundef %261) #10
  %263 = sub i64 %262, 1
  %264 = getelementptr inbounds [256 x i8], ptr %4, i64 0, i64 %263
  store i8 0, ptr %264, align 1, !tbaa !16
  %265 = load ptr, ptr @stderr, align 8, !tbaa !5
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %265, ptr noundef @.str.9, ptr noundef @.str.8, ptr noundef %266) #7
  call void @exit(i32 noundef 1) #9
  unreachable

268:                                              ; preds = %255
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %185, !llvm.loop !26

269:                                              ; preds = %185
  store i32 0, ptr %9, align 4
  br label %270

270:                                              ; preds = %269, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %271 = load i32, ptr %9, align 4
  switch i32 %271, label %382 [
    i32 0, label %272
    i32 4, label %91
  ]

272:                                              ; preds = %270
  br label %91, !llvm.loop !27

273:                                              ; preds = %91
  %274 = load ptr, ptr %5, align 8, !tbaa !5
  %275 = call i32 @fclose(ptr noundef %274)
  %276 = load ptr, ptr %2, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.BuildCtx, ptr %276, i32 0, i32 1
  %278 = load i32, ptr %277, align 8, !tbaa !9
  %279 = icmp eq i32 %278, 7
  br i1 %279, label %280, label %282

280:                                              ; preds = %273
  %281 = load ptr, ptr %2, align 8, !tbaa !5
  call void @libdef_endmodule(ptr noundef %281)
  br label %282

282:                                              ; preds = %280, %273
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr %4) #7
  br label %56, !llvm.loop !28

283:                                              ; preds = %56
  %284 = load ptr, ptr %2, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.BuildCtx, ptr %284, i32 0, i32 1
  %286 = load i32, ptr %285, align 8, !tbaa !9
  %287 = icmp eq i32 %286, 6
  br i1 %287, label %288, label %298

288:                                              ; preds = %283
  %289 = load ptr, ptr %2, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.BuildCtx, ptr %289, i32 0, i32 2
  %291 = load ptr, ptr %290, align 8, !tbaa !13
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %291, ptr noundef @.str.10) #7
  %293 = load ptr, ptr %2, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.BuildCtx, ptr %293, i32 0, i32 2
  %295 = load ptr, ptr %294, align 8, !tbaa !13
  %296 = load i32, ptr @ffasmfunc, align 4, !tbaa !14
  %297 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %295, ptr noundef @.str.11, i32 noundef %296) #7
  br label %381

298:                                              ; preds = %283
  %299 = load ptr, ptr %2, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.BuildCtx, ptr %299, i32 0, i32 1
  %301 = load i32, ptr %300, align 8, !tbaa !9
  %302 = icmp eq i32 %301, 9
  br i1 %302, label %303, label %308

303:                                              ; preds = %298
  %304 = load ptr, ptr %2, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.BuildCtx, ptr %304, i32 0, i32 2
  %306 = load ptr, ptr %305, align 8, !tbaa !13
  %307 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %306, ptr noundef @.str.12) #7
  br label %380

308:                                              ; preds = %298
  %309 = load ptr, ptr %2, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.BuildCtx, ptr %309, i32 0, i32 1
  %311 = load i32, ptr %310, align 8, !tbaa !9
  %312 = icmp eq i32 %311, 5
  br i1 %312, label %313, label %344

313:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %314 = load ptr, ptr %2, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.BuildCtx, ptr %314, i32 0, i32 2
  %316 = load ptr, ptr %315, align 8, !tbaa !13
  %317 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %316, ptr noundef @.str.13) #7
  %318 = load ptr, ptr %2, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.BuildCtx, ptr %318, i32 0, i32 2
  %320 = load ptr, ptr %319, align 8, !tbaa !13
  %321 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %320, ptr noundef @.str.14) #7
  %322 = load ptr, ptr %2, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.BuildCtx, ptr %322, i32 0, i32 2
  %324 = load ptr, ptr %323, align 8, !tbaa !13
  %325 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %324, ptr noundef @.str.15) #7
  %326 = load i32, ptr @ffasmfunc, align 4, !tbaa !14
  %327 = sub nsw i32 %326, 1
  store i32 %327, ptr %13, align 4, !tbaa !14
  br label %328

328:                                              ; preds = %336, %313
  %329 = load i32, ptr %13, align 4, !tbaa !14
  %330 = icmp sgt i32 %329, 0
  br i1 %330, label %331, label %339

331:                                              ; preds = %328
  %332 = load ptr, ptr %2, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.BuildCtx, ptr %332, i32 0, i32 2
  %334 = load ptr, ptr %333, align 8, !tbaa !13
  %335 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %334, ptr noundef @.str.16) #7
  br label %336

336:                                              ; preds = %331
  %337 = load i32, ptr %13, align 4, !tbaa !14
  %338 = add nsw i32 %337, -1
  store i32 %338, ptr %13, align 4, !tbaa !14
  br label %328, !llvm.loop !29

339:                                              ; preds = %328
  %340 = load ptr, ptr %2, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.BuildCtx, ptr %340, i32 0, i32 2
  %342 = load ptr, ptr %341, align 8, !tbaa !13
  %343 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %342, ptr noundef @.str.17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %379

344:                                              ; preds = %308
  %345 = load ptr, ptr %2, align 8, !tbaa !5
  %346 = getelementptr inbounds %struct.BuildCtx, ptr %345, i32 0, i32 1
  %347 = load i32, ptr %346, align 8, !tbaa !9
  %348 = icmp eq i32 %347, 8
  br i1 %348, label %349, label %378

349:                                              ; preds = %344
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr @obuf, ptr %14, align 8, !tbaa !5
  %350 = load ptr, ptr %2, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.BuildCtx, ptr %350, i32 0, i32 2
  %352 = load ptr, ptr %351, align 8, !tbaa !13
  %353 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %352, ptr noundef @.str.13) #7
  %354 = load ptr, ptr %2, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.BuildCtx, ptr %354, i32 0, i32 2
  %356 = load ptr, ptr %355, align 8, !tbaa !13
  %357 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %356, ptr noundef @.str.18) #7
  br label %358

358:                                              ; preds = %362, %349
  %359 = load ptr, ptr %14, align 8, !tbaa !5
  %360 = load i8, ptr %359, align 1, !tbaa !16
  %361 = icmp ne i8 %360, 0
  br i1 %361, label %362, label %373

362:                                              ; preds = %358
  %363 = load ptr, ptr %2, align 8, !tbaa !5
  %364 = getelementptr inbounds %struct.BuildCtx, ptr %363, i32 0, i32 2
  %365 = load ptr, ptr %364, align 8, !tbaa !13
  %366 = load ptr, ptr %14, align 8, !tbaa !5
  %367 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %365, ptr noundef @.str.19, ptr noundef %366) #7
  %368 = load ptr, ptr %14, align 8, !tbaa !5
  %369 = call i64 @strlen(ptr noundef %368) #10
  %370 = add i64 %369, 1
  %371 = load ptr, ptr %14, align 8, !tbaa !5
  %372 = getelementptr inbounds i8, ptr %371, i64 %370
  store ptr %372, ptr %14, align 8, !tbaa !5
  br label %358, !llvm.loop !30

373:                                              ; preds = %358
  %374 = load ptr, ptr %2, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct.BuildCtx, ptr %374, i32 0, i32 2
  %376 = load ptr, ptr %375, align 8, !tbaa !13
  %377 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %376, ptr noundef @.str.13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %378

378:                                              ; preds = %373, %344
  br label %379

379:                                              ; preds = %378, %339
  br label %380

380:                                              ; preds = %379, %303
  br label %381

381:                                              ; preds = %380, %288
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret void

382:                                              ; preds = %270, %249
  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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #3

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

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #6

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #6

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strcspn(ptr noundef, ptr noundef) #6

declare i32 @fclose(ptr noundef) #3

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

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 = { "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 = { nounwind willreturn memory(none) "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 = { noreturn 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!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, !11, i64 8}
!10 = !{!"BuildCtx", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !7, i64 152}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !6, i64 16}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 32}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !6, i64 0}
!20 = !{!"LibDefHandler", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!21 = !{!12, !12, i64 0}
!22 = !{!20, !6, i64 8}
!23 = !{!20, !6, i64 16}
!24 = !{!20, !11, i64 24}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}
!29 = distinct !{!29, !18}
!30 = distinct !{!30, !18}


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

@.str = external hidden unnamed_addr constant [47 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@ffid = external hidden local_unnamed_addr global i32, align 4
@recffid = external hidden local_unnamed_addr global i32, align 4
@ffasmfunc = external hidden local_unnamed_addr global i32, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [40 x i8], align 1
@modstate = external hidden local_unnamed_addr global i32, align 4
@regfunc = external hidden local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@libdef_handlers = external hidden local_unnamed_addr constant [11 x %struct.LibDefHandler], align 16
@.str.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@obuf = external hidden global [8192 x i8], align 16
@.str.18 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1
@switch.table.emit_lib = private unnamed_addr constant [4 x ptr] [ptr @.str, ptr @.str, ptr @.str, ptr @.str.1], align 8

; Function Attrs: nounwind uwtable
define dso_local void @emit_lib(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [256 x i8], align 16
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %switch.tableidx = add i32 %4, -6
  %5 = icmp ult i32 %switch.tableidx, 4
  br i1 %5, label %switch.lookup, label %.thread

switch.lookup:                                    ; preds = %1
  %6 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [4 x ptr], ptr @switch.table.emit_lib, i64 0, i64 %6
  %switch.load = load ptr, ptr %switch.gep, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull %switch.load) #7
  %.pr = load i32, ptr %3, align 8, !tbaa !5
  %10 = icmp eq i32 %.pr, 8
  br i1 %10, label %11, label %.thread

11:                                               ; preds = %switch.lookup
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.2) #7
  br label %.thread

.thread:                                          ; preds = %1, %11, %switch.lookup
  store i32 2, ptr @ffid, align 4, !tbaa !13
  store i32 2, ptr @recffid, align 4, !tbaa !13
  store i32 0, ptr @ffasmfunc, align 4, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %0, i64 32
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  store ptr %17, ptr %15, align 8, !tbaa !14
  %18 = load ptr, ptr %16, align 8, !tbaa !15
  %.not154 = icmp eq ptr %18, null
  br i1 %.not154, label %._crit_edge156, label %.lr.ph155

.lr.ph155:                                        ; preds = %.thread
  %19 = getelementptr inbounds i8, ptr %2, i64 1
  %20 = getelementptr inbounds i8, ptr %2, i64 2
  %21 = load ptr, ptr @libdef_handlers, align 16
  %.not119139 = icmp eq ptr %21, null
  br label %22

22:                                               ; preds = %.lr.ph155, %104
  %23 = phi ptr [ %18, %.lr.ph155 ], [ %107, %104 ]
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %2) #7
  %24 = load i8, ptr %23, align 1, !tbaa !16
  %25 = icmp eq i8 %24, 45
  br i1 %25, label %26, label %32

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %23, i64 1
  %28 = load i8, ptr %27, align 1, !tbaa !16
  %29 = icmp eq i8 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %26
  %31 = load ptr, ptr @stdin, align 8, !tbaa !15
  br label %40

32:                                               ; preds = %26, %22
  %33 = call noalias ptr @fopen(ptr noundef nonnull %23, ptr noundef nonnull @.str.3)
  %.not111 = icmp eq ptr %33, null
  br i1 %.not111, label %34, label %40

34:                                               ; preds = %32
  %35 = load ptr, ptr @stderr, align 8, !tbaa !15
  %36 = tail call ptr @__errno_location() #8
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = call ptr @strerror(i32 noundef %37) #7
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.4, ptr noundef nonnull %23, ptr noundef %38) #9
  call void @exit(i32 noundef 1) #10
  unreachable

40:                                               ; preds = %32, %30
  %.094 = phi ptr [ %31, %30 ], [ %33, %32 ]
  store i32 0, ptr @modstate, align 4, !tbaa !13
  store i32 0, ptr @regfunc, align 4, !tbaa !13
  %41 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 256, ptr noundef %.094)
  %.not112150 = icmp eq ptr %41, null
  br i1 %.not112150, label %._crit_edge153, label %.lr.ph152

.lr.ph152:                                        ; preds = %40, %.critedge._crit_edge
  %42 = load i8, ptr %2, align 16, !tbaa !16
  %43 = icmp eq i8 %42, 35
  %44 = load i8, ptr %19, align 1
  %45 = icmp eq i8 %44, 105
  %or.cond = select i1 %43, i1 %45, i1 false
  %46 = load i8, ptr %20, align 2
  %47 = icmp eq i8 %46, 102
  %or.cond7 = select i1 %or.cond, i1 %47, i1 false
  br i1 %or.cond7, label %48, label %.critedge124

48:                                               ; preds = %.lr.ph152
  %49 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.5) #11
  %.not113.not = icmp eq i32 %49, 0
  br i1 %.not113.not, label %.critedge.preheader, label %.critedge124

.critedge.preheader:                              ; preds = %48
  %50 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 256, ptr noundef %.094)
  %.not117137 = icmp eq ptr %50, null
  br i1 %.not117137, label %.critedge._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.critedge.preheader, %.critedge
  %.099138 = phi i32 [ %.1100, %.critedge ], [ 1, %.critedge.preheader ]
  %51 = load i8, ptr %2, align 16, !tbaa !16
  %52 = icmp eq i8 %51, 35
  %53 = load i8, ptr %19, align 1
  %54 = icmp eq i8 %53, 101
  %or.cond11 = select i1 %52, i1 %54, i1 false
  %55 = load i8, ptr %20, align 2
  %56 = icmp eq i8 %55, 110
  %or.cond15 = select i1 %or.cond11, i1 %56, i1 false
  br i1 %or.cond15, label %57, label %60

57:                                               ; preds = %.lr.ph
  %58 = add nsw i32 %.099138, -1
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %.critedge._crit_edge, label %.critedge

60:                                               ; preds = %.lr.ph
  %61 = icmp eq i8 %53, 105
  %or.cond19 = select i1 %52, i1 %61, i1 false
  %62 = icmp eq i8 %55, 102
  %or.cond23 = select i1 %or.cond19, i1 %62, i1 false
  %63 = zext i1 %or.cond23 to i32
  %spec.select = add nsw i32 %.099138, %63
  br label %.critedge

.critedge:                                        ; preds = %60, %57
  %.1100 = phi i32 [ %58, %57 ], [ %spec.select, %60 ]
  %64 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 256, ptr noundef %.094)
  %.not117 = icmp eq ptr %64, null
  br i1 %.not117, label %.critedge._crit_edge, label %.lr.ph, !llvm.loop !17

.critedge124:                                     ; preds = %48, %.lr.ph152
  %65 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.8) #11
  %.not118146 = icmp eq ptr %65, null
  br i1 %.not118146, label %.critedge._crit_edge, label %.lr.ph147

.lr.ph147:                                        ; preds = %.critedge124
  br i1 %.not119139, label %.lr.ph147.split.us, label %.lr.ph142

.lr.ph147.split.us:                               ; preds = %.lr.ph147
  %66 = getelementptr inbounds i8, ptr %65, i64 6
  br label %._crit_edge144

.lr.ph142:                                        ; preds = %.lr.ph147, %92
  %67 = phi ptr [ %93, %92 ], [ %65, %.lr.ph147 ]
  %68 = getelementptr inbounds i8, ptr %67, i64 6
  br label %69

69:                                               ; preds = %.lr.ph142, %89
  %70 = phi ptr [ %21, %.lr.ph142 ], [ %91, %89 ]
  %.096140 = phi ptr [ @libdef_handlers, %.lr.ph142 ], [ %90, %89 ]
  %71 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %70) #11
  %72 = call i32 @strncmp(ptr noundef nonnull %68, ptr noundef nonnull %70, i64 noundef %71) #11
  %.not120 = icmp eq i32 %72, 0
  br i1 %.not120, label %73, label %89

73:                                               ; preds = %69
  %74 = getelementptr inbounds i8, ptr %68, i64 %71
  %75 = getelementptr inbounds i8, ptr %.096140, i64 8
  %76 = load ptr, ptr %75, align 8, !tbaa !19
  %.not121 = icmp eq ptr %76, null
  br i1 %.not121, label %79, label %77

77:                                               ; preds = %73
  %78 = call i64 @strcspn(ptr noundef nonnull %74, ptr noundef nonnull %76) #11
  br label %79

79:                                               ; preds = %73, %77
  %80 = phi i64 [ %78, %77 ], [ 0, %73 ]
  %81 = getelementptr inbounds i8, ptr %74, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !16
  %.not122 = icmp eq i8 %82, 0
  br i1 %.not122, label %92, label %83

83:                                               ; preds = %79
  store i8 0, ptr %81, align 1, !tbaa !16
  %84 = getelementptr inbounds i8, ptr %.096140, i64 16
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  %86 = getelementptr inbounds i8, ptr %.096140, i64 24
  %87 = load i32, ptr %86, align 8, !tbaa !22
  call void %85(ptr noundef %0, ptr noundef nonnull %74, i32 noundef %87) #7
  %88 = getelementptr i8, ptr %81, i64 1
  br label %92

89:                                               ; preds = %69
  %90 = getelementptr inbounds i8, ptr %.096140, i64 32
  %91 = load ptr, ptr %90, align 8, !tbaa !23
  %.not119 = icmp eq ptr %91, null
  br i1 %.not119, label %._crit_edge144, label %69, !llvm.loop !24

92:                                               ; preds = %83, %79
  %.2.ph = phi ptr [ %74, %79 ], [ %88, %83 ]
  %93 = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %.2.ph, ptr noundef nonnull dereferenceable(1) @.str.8) #11
  %.not118 = icmp eq ptr %93, null
  br i1 %.not118, label %.critedge._crit_edge, label %.lr.ph142, !llvm.loop !25

._crit_edge144:                                   ; preds = %89, %.lr.ph147.split.us
  %.lcssa133 = phi ptr [ %66, %.lr.ph147.split.us ], [ %68, %89 ]
  %94 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #11
  %95 = add i64 %94, -1
  %96 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 %95
  store i8 0, ptr %96, align 1, !tbaa !16
  %97 = load ptr, ptr @stderr, align 8, !tbaa !15
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.8, ptr noundef nonnull %.lcssa133) #9
  call void @exit(i32 noundef 1) #10
  unreachable

.critedge._crit_edge:                             ; preds = %92, %.critedge, %57, %.critedge124, %.critedge.preheader
  %99 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 256, ptr noundef %.094)
  %.not112 = icmp eq ptr %99, null
  br i1 %.not112, label %._crit_edge153, label %.lr.ph152

._crit_edge153:                                   ; preds = %.critedge._crit_edge, %40
  %100 = call i32 @fclose(ptr noundef %.094)
  %101 = load i32, ptr %3, align 8, !tbaa !5
  %102 = icmp eq i32 %101, 7
  br i1 %102, label %103, label %104

103:                                              ; preds = %._crit_edge153
  call void @libdef_endmodule(ptr noundef nonnull %0)
  br label %104

104:                                              ; preds = %103, %._crit_edge153
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %2) #7
  %105 = load ptr, ptr %15, align 8, !tbaa !14
  %106 = getelementptr inbounds i8, ptr %105, i64 8
  store ptr %106, ptr %15, align 8, !tbaa !14
  %107 = load ptr, ptr %105, align 8, !tbaa !15
  %.not = icmp eq ptr %107, null
  br i1 %.not, label %._crit_edge156, label %22, !llvm.loop !26

._crit_edge156:                                   ; preds = %104, %.thread
  %108 = load i32, ptr %3, align 8, !tbaa !5
  switch i32 %108, label %150 [
    i32 6, label %109
    i32 9, label %116
    i32 5, label %120
    i32 8, label %135
  ]

109:                                              ; preds = %._crit_edge156
  %110 = getelementptr inbounds i8, ptr %0, i64 16
  %111 = load ptr, ptr %110, align 8, !tbaa !12
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.10) #7
  %113 = load ptr, ptr %110, align 8, !tbaa !12
  %114 = load i32, ptr @ffasmfunc, align 4, !tbaa !13
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef nonnull @.str.11, i32 noundef %114) #7
  br label %150

116:                                              ; preds = %._crit_edge156
  %117 = getelementptr inbounds i8, ptr %0, i64 16
  %118 = load ptr, ptr %117, align 8, !tbaa !12
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str.12) #7
  br label %150

120:                                              ; preds = %._crit_edge156
  %121 = getelementptr inbounds i8, ptr %0, i64 16
  %122 = load ptr, ptr %121, align 8, !tbaa !12
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str.13) #7
  %124 = load ptr, ptr %121, align 8, !tbaa !12
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef nonnull @.str.14) #7
  %126 = load ptr, ptr %121, align 8, !tbaa !12
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef nonnull @.str.15) #7
  %128 = load i32, ptr @ffasmfunc, align 4, !tbaa !13
  %129 = icmp sgt i32 %128, 1
  br i1 %129, label %.lr.ph164, label %._crit_edge165

.lr.ph164:                                        ; preds = %120, %.lr.ph164
  %.093.in162 = phi i32 [ %.093, %.lr.ph164 ], [ %128, %120 ]
  %.093 = add nsw i32 %.093.in162, -1
  %130 = load ptr, ptr %121, align 8, !tbaa !12
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.16) #7
  %132 = icmp ugt i32 %.093.in162, 2
  br i1 %132, label %.lr.ph164, label %._crit_edge165, !llvm.loop !27

._crit_edge165:                                   ; preds = %.lr.ph164, %120
  %133 = load ptr, ptr %121, align 8, !tbaa !12
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str.17) #7
  br label %150

135:                                              ; preds = %._crit_edge156
  %136 = getelementptr inbounds i8, ptr %0, i64 16
  %137 = load ptr, ptr %136, align 8, !tbaa !12
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef nonnull @.str.13) #7
  %139 = load ptr, ptr %136, align 8, !tbaa !12
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef nonnull @.str.18) #7
  %141 = load i8, ptr @obuf, align 16, !tbaa !16
  %.not110157 = icmp eq i8 %141, 0
  br i1 %.not110157, label %._crit_edge161, label %.lr.ph160

.lr.ph160:                                        ; preds = %135, %.lr.ph160
  %.0158 = phi ptr [ %146, %.lr.ph160 ], [ @obuf, %135 ]
  %142 = load ptr, ptr %136, align 8, !tbaa !12
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef nonnull @.str.19, ptr noundef nonnull %.0158) #7
  %144 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.0158) #11
  %145 = add i64 %144, 1
  %146 = getelementptr inbounds i8, ptr %.0158, i64 %145
  %147 = load i8, ptr %146, align 1, !tbaa !16
  %.not110 = icmp eq i8 %147, 0
  br i1 %.not110, label %._crit_edge161, label %.lr.ph160, !llvm.loop !28

._crit_edge161:                                   ; preds = %.lr.ph160, %135
  %148 = load ptr, ptr %136, align 8, !tbaa !12
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef nonnull @.str.13) #7
  br label %150

150:                                              ; preds = %._crit_edge156, %116, %._crit_edge161, %._crit_edge165, %109
  ret void
}

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

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strcspn(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

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

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 = { 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 #3 = { 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 #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { noreturn 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(read) }

!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, !10, i64 8}
!6 = !{!"BuildCtx", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !11, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !8, i64 152}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !7, i64 16}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !7, i64 32}
!15 = !{!7, !7, i64 0}
!16 = !{!8, !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !7, i64 8}
!20 = !{!"LibDefHandler", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!21 = !{!20, !7, i64 16}
!22 = !{!20, !10, i64 24}
!23 = !{!20, !7, i64 0}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass